package com.example.boot.service

import com.example.boot.domain.Settings
import com.example.boot.domain.SettingsV2
import com.ninjasquad.springmockk.MockkBean
import io.mockk.impl.annotations.MockK
import io.mockk.junit5.MockKExtension
import org.junit.jupiter.api.Test

import org.junit.jupiter.api.Assertions.*
import org.junit.jupiter.api.extension.ExtendWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import java.math.BigInteger

@SpringBootTest
//@ExtendWith(MockKExtension::class)
class SettingsServiceImplTest {
    @Autowired
//    @MockK
    lateinit var settingsService: SettingsService

    @Test
    fun createSettings() {
        val settings = Settings(BigInteger.valueOf(1000), "test_name", "test_value")
        val created = settingsService.createSettings(settings)
        println(created.name)
    }

    @Test
    fun createSettingsV2() {
        val settings = Settings("test_name2", "test_value2")
        val created = settingsService.createSettings(settings)
        println(created.name)
    }

    @Test
    fun createSettingsV3() {
        val settings = SettingsV2(BigInteger.valueOf(2000), "test_name3", "test_value3")
        val name = settingsService.createSettingsV2(settings).name
        println(name)
    }

    @Test
    fun createSettingsV3WithId() {
        val settings = SettingsV2(BigInteger.valueOf(2000), "test_name3", "test_value3")
        val name = settingsService.createSettingsV2WithId(settings).name
        println(name)
    }

    @Test
    fun createSettingsV4() {
        val settings = SettingsV2(BigInteger.valueOf(3000), "test_name4", "test_value4")
        settingsService.createSettingsV3(settings)
        println(settings.name)
    }
}